<?php

namespace app\api\controller;

use app\admin\model\money\Change;
use app\admin\model\product\Category;
use app\admin\model\product\Listo;
use app\admin\model\product\Lists;
use app\admin\model\product\Order;
use app\admin\model\product\Sku;
use app\admin\model\product\Value;
use app\admin\model\user\Finance;
use app\common\api\controller\Relation;
use app\common\model\Member;
use app\common\model\MemberFinance;
use think\Db;
use think\Request;
use app\common\controller\Api;
use think\Validate;

class Statics extends Api
{
    protected static $model = null;
    protected $noNeedRight = '*';

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        self::$model = new \app\admin\model\user\Statics();
    }

    /**
     * 冻结列表
     * @throws \think\exception\DbException
     */
    public function index()
    {
        $pageSize = input('page_size', 15);
        $userId = $this->auth->id;
        $list = self::$model
            ->where('user_id', $userId)
            ->order('id desc')
            ->paginate($pageSize)->each(function ($item) {
                $item['createtime'] = date('Y-m-d H:i:s', $item['createtime']);
            });

        $this->success('冻结列表', $list);
    }
}